#include "enternext.h"
#include<QPainter>
#include"mypushbutton.h"
#include"scene.h"

Enternext::Enternext(QWidget *parent)
    : QMainWindow{parent}
{
    this->setFixedSize(800,600);
    this->setWindowTitle("一二大战布布");

}

void Enternext::paintEvent(QPaintEvent *)
{
    QPainter painter0(this);
    QPixmap pix;
    pix.load(":/picture/second.jpg");
    painter0.drawPixmap(0,0,this->width(),this->height(),pix);

    //设置开始按钮
    myPushButton* startbtn1=new myPushButton(":/picture/begin.jpg");
    startbtn1->setParent(this);
    startbtn1->move(this->width()*0.15,this->height()*0.3);
    startbtn1->show();
    //利用信号与槽，点击进入游戏
    connect (startbtn1,&myPushButton::clicked,[=](){
        qDebug()<<"开始游戏";
        //进入开始场景中
        this->hide();
        scene = new Scene;
        scene ->show();
    });
}
